<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        const promise = new Promise((reslove, reject) => {
            reslove(100)
        })

        // const p1 = promise.then((value) => {
        //     console.log(value)
        //     return p1
        // })

        // p1.then(() => {}, (err) => {
        //     console.log(err)
        // })

        // promise.then()
        //         .then()
        //         .then(console.log)

        const p1 = new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve('aa')
            })
        })

        const p2 = new Promise((resolve, reject) => {
            // resolve('bb')
            reject('cc')
        })

        Promise.all(['1', '2', p1, p2, '3']).then((res) => {
            console.log(res)
        })

        Promise.allSettled(['1', '2', p1, p2, '3']).then((res) => {
            console.log(res, 'allSettled')
        })
    </script>
</body>
</html>